﻿using System;
using System.Linq.Expressions;
using Domain.Core.Specification;
using Domain.MainModule.Entities;

namespace Domain.MainModule.CustomerServices
{
    public class CustomerServiceIdSpecification : Specification<CustomerService>
    {
        #region public properties

        public Guid CustomerServiceId
        {
            get;
            set;
        }

        #endregion

        #region constructor

        public CustomerServiceIdSpecification(Guid customerServiceId)
        {
            this.CustomerServiceId = customerServiceId;
        }

        #endregion

        #region public methods

        public override Expression<Func<CustomerService, bool>> SatisfiedBy()
        {
            Specification<CustomerService> spec = new TrueSpecification<CustomerService>();
            spec &= new DirectSpecification<CustomerService>(c => c.CustomerServiceId == this.CustomerServiceId);

            return spec.SatisfiedBy();
        }

        #endregion
    }
}
